<template>
    <div>
        <!-- 显示的是类别 -->
        <div id="slider" class="mui-slider">
				<div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
					<div class="mui-scroll">
						<a :class="['mui-control-item',item.title === '师资'?' mui-active':'']" href="#item1mobile" data-wid="tab-top-subpage-1.html" v-for="item in ts" :key="item.id">
							{{item.title}}
						</a>
					</div>
				</div>

			</div>

            <!-- 显示的是所有的图片 -->
            <ul>
			<router-link v-for="item in list" :key="item.id" :to="'/photoList/photoInfo/'+item.id">
				<img lazy='loading' :src="imgbase+item.imgurl"/>
			</router-link>
		</ul>
      
    </div>
</template>
<script>
import mui from "../../lib/mui/js/mui.min.js"
export default {
    data(){
        return {
            ts:[],
            list:[],
            imgbase:"http://localhost:3000/images/"
        }
    },
    created(){
        let t = {'id':0,'title':'全部'}
        this.getAllTypes();
        this.ts.unshift(t);
        console.log(this.ts);
        this.getImgs();
    },
    methods:{
        getAllTypes(){
            this.$ajax({
                url:"/phtyps",
                method:"get"

            }).then(resp=>{
                this.ts = resp.data.message;

            });
        },
        //查询所有的图片
        getImgs(){
            this.$ajax({
                url:"/lanimgs",
                method:"get"
            }).then(resp=>{
                this.list = resp.data.message;

            });

        }

    },
    mounted(){
		mui('.mui-scroll-wrapper').scroll({
			deceleration: 0.0005 //flick 减速系数，系数越大，滚动速度越慢，滚动距离越小，默认值0.0006
		});
		
	}
    
}

</script>
<style  scoped>
* { touch-action: pan-y; } 
img[lazy='loading'] {
 width:100%;
	height: 100%;
  margin: auto;
} 
ul{
	list-style: none;
	margin: 0;
	padding: 10px;
	padding-bottom:0px;
}
li{
	background-color: #ccc;
	text-align: center;
	margin-bottom:10px;
	box-shadow:  0 0 6px ;
	

}
.info{
	color:white;
	position: absolute;
	bottom: 0;
	background-color: rgba(0,0,0,0.4);

}
.info-title{
	font-size:14px;

}
.info-body{
	font-size:13px;
}
</style>
